package com.zh.demo;

import com.aspose.pdf.Document;
import com.aspose.pdf.SaveFormat;

/**
 * 利用Aspose.Pdf转换PDF文件为Word文件
 */
public class Pdf2Docx {
    public static void main(String[] args) {
        // 替换为实际的PDF文件路径
        String pdfFilePath = "C:\\Users\\zhjx2\\Documents\\卡号1_停车记录有边框.pdf";
        // 替换为输出Word文件路径
        String wordFilePath = "C:\\Users\\zhjx2\\Documents\\output.docx";
        try {
            Document pdfDocument = new Document(pdfFilePath);
            pdfDocument.save(wordFilePath, SaveFormat.DocX);
            System.out.println("PDF转换Word成功");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
